package net.jdm.domain.dependence;

import net.jdm.domain.entity.Node;

public class Dependence {
	private final Node from;
	private final Node to;
	public Dependence(Node from, Node to) {
		this.from = from;
		this.to = to;
	};
	public Node getFrom() {
		return from;
	}
	public Node getTo() {
		return to;
	}
	@Override
	public int hashCode() {
		return this.toString().hashCode();
	}
	@Override
	public String toString() {
		return this.from.getName() + "->" + this.to.getName();
	}
	@Override
	public boolean equals(Object other) {
		if (other!=null&&this.getClass().equals(other.getClass())) {
			ContainerDependence otherDependence = (ContainerDependence) other;
			return this.toString().equals(otherDependence.toString());
		}
		return false;
	}
}
